import axios from "axios";

var _http = axios.create({
  baseURL: "http://localhost:8080/jeecg-boot",
  // baseURL: "https://www.bjyamyy.cn/crm_service/jeecg-boot/",
  timeout: 30 * 1000,
  headers: { "X-Custom-Header": "foobar" }
});

//添加请求拦截器
_http.interceptors.request.use(
  function(config) {
    // config.params = {enterpriseId: 2}
    // 返回配置项
    return config;
  },

  function(error) {
    //请求错误时做些事
    return Promise.reject(error);
  }
);

export default _http;